/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * articulos_sie_almacen_movi_extras_detalle.java
 *
 * Created on 11/08/2011, 02:32:58 PM
 */

package sie_invdis;


import java.sql.*;
import javax.swing.*;

import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTable.*;
import java.awt.*;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.text.*;

/**
 *
 * @author Michelle
 */
public class articulos_sie_almacen_movi_extras_detalle  extends javax.swing.JFrame {

     private javax.swing.table.DefaultTableModel jtable_modelo_moviextra;
    private javax.swing.table.DefaultTableModel jtable_modelo_moviextrad;

    private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
    private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");

    bd_conexion x = new bd_conexion() ;
    //se creaa la variable resultset
    ResultSet rs = null;
    int statusdocumento=0,yacarguefot=0,tabcontrol=0;
    String textohtml="";
    /** Creates new form articulos_sie_almacen_movi_extras_detalle */
public articulos_sie_almacen_movi_extras_detalle() {
        initComponents();
    }

public articulos_sie_almacen_movi_extras_detalle(String idfolio,String idtienda) {
        this.iniciar_modelo_movimientoextra();
        this.iniciar_modelo_movimientoextrad();
        initComponents();
        this.carga_datos_movextras(2,idfolio,idtienda);
        this.carga_datos_detalle(0, idtienda, idfolio);
        this.setTitle("S.I. Movimientos Extras Folio:"+this.jtf_movimientos.getText());

            jt_foliosdetalle.getColumnModel().getColumn(0).setPreferredWidth(65);//tem ent
            jt_foliosdetalle.getColumnModel().getColumn(1).setPreferredWidth(120);//Familia
            jt_foliosdetalle.getColumnModel().getColumn(2).setPreferredWidth(80);//Subfamilia
            jt_foliosdetalle.getColumnModel().getColumn(3).setPreferredWidth(10);//Clave
            jt_foliosdetalle.getColumnModel().getColumn(4).setPreferredWidth(30);//Descripcion
            jt_foliosdetalle.getColumnModel().getColumn(5).setPreferredWidth(30);//Descripcion
            jt_foliosdetalle.getColumnModel().getColumn(6).setPreferredWidth(30);//Descripcion
            jt_foliosdetalle.getColumnModel().getColumn(7).setPreferredWidth(30);//Descripcion
            this.jtf_idtienda.setText(idtienda);

            jt_foliosdetalle1.getColumnModel().getColumn(0).setPreferredWidth(60);//Clave
            jt_foliosdetalle1.getColumnModel().getColumn(1).setPreferredWidth(30);//codigo
            jt_foliosdetalle1.getColumnModel().getColumn(2).setPreferredWidth(80);//descripcion
            jt_foliosdetalle1.getColumnModel().getColumn(3).setPreferredWidth(10);//costo
            jt_foliosdetalle1.getColumnModel().getColumn(4).setPreferredWidth(10);//precio
            jt_foliosdetalle1.getColumnModel().getColumn(5).setPreferredWidth(10);//exis
            jt_foliosdetalle1.getColumnModel().getColumn(6).setPreferredWidth(60);//Clave
            jt_foliosdetalle1.getColumnModel().getColumn(7).setPreferredWidth(40);//codigo
            jt_foliosdetalle1.getColumnModel().getColumn(8).setPreferredWidth(60);//descripcion
            jt_foliosdetalle1.getColumnModel().getColumn(9).setPreferredWidth(10);//costo
            jt_foliosdetalle1.getColumnModel().getColumn(10).setPreferredWidth(10);//precio
            jt_foliosdetalle1.getColumnModel().getColumn(11).setPreferredWidth(10);//exis
            jt_foliosdetalle1.getColumnModel().getColumn(12).setPreferredWidth(10);//cantidad
            jt_foliosdetalle1.getColumnModel().getColumn(13).setPreferredWidth(60);//Observa
            tabcontrol=1;
    }



private void iniciar_modelo_movimientoextra()
    {
        jtable_modelo_moviextra=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_moviextra.addColumn("<html><b>Clave</b></html>");
        jtable_modelo_moviextra.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_moviextra.addColumn("<html><b>Unidad</b></html>");
        jtable_modelo_moviextra.addColumn("<html><b>Cant.</b></html>");
        jtable_modelo_moviextra.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_moviextra.addColumn("<html><b>Precio</b></html>");
        jtable_modelo_moviextra.addColumn("<html><b>Importe C.</b></html>");
        jtable_modelo_moviextra.addColumn("<html><b>Importe P.</b></html>");
   }
private void iniciar_modelo_movimientoextrad()
    {
        jtable_modelo_moviextrad=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_moviextrad.addColumn("<html><b>Clave O.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Codigo O.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Descripcion O.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Costo.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Precio O.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Exi.O.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Clave D.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Codigo D.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Descripcion D.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Precio D.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Exi. D.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Can.</b></html>");
        jtable_modelo_moviextrad.addColumn("<html><b>Razon</b></html>");

   }

private void carga_datos_movextras(int opbus,String tbusca,String idtienda)
{
       String fechacat = "",fechaorigen="",fechaentrega="";
       DecimalFormat miformat = new DecimalFormat("############.####");
       Object[] fnewRow = new Object[8];
      
       String arreglo_idtie[]=null;
       String cadenasql="select * from x1sieuno_articulo_almacen_movextras("+opbus+","+idtienda+",'"+tbusca+"') as (idmovi integer,idniv1 integer,totalventa real,idstatus integer,observa text,idtipomov integer,fecha date,hora time,idempleado integer,fechames text,cantidad real,importeprecio real,importecosto double precision,nombreempleado text,statusdescrip text,movimientoextradescribe text,diastras integer);";
       //invoco al metodo que trae el recordset de datos
       System.out.println(cadenasql);

        try
         {
            rs = x.sieuno_executediversosv2(cadenasql,variables_global.getconexiongral());
            while (rs.next())
                {
                    fechaentrega="";
                    arreglo_idtie=rs.getString ("statusdescrip").toString().split(":");
                    this.jtf_movimientos.setText(rs.getString("idtipomov")+":"+rs.getString("movimientoextradescribe"));
                    this.jtf_foliotienda.setText(rs.getString("idmovi"));
                    this.tf_status.setText(rs.getString("idstatus")+":"+arreglo_idtie[1]);
                    this.tf_tiendaorigen.setText(arreglo_idtie[2]+":"+arreglo_idtie[0]);
                    this.jtf_elaboro.setText(rs.getString("nombreempleado"));
                    fechaorigen=""+this.fechaeuropea(rs.getString("fecha"))+":"+DiaSemana(this.fechaeuropea(rs.getString ("fecha")))+" "+rs.getString ("hora").substring(0, 5)+"";
                    this.jtf_fecharecibidotienda.setText(fechaorigen);
                    this.jtf_piezaenvia.setText(miformat.format(rs.getDouble("cantidad")));
                    this.jtf_importecosto.setText(miformat.format(rs.getDouble("importecosto")));
                    this.jtf_importeprecio.setText(miformat.format(rs.getDouble("importeprecio")));
                    this.jep_observaenvio.setText(rs.getString("observa"));
                }
        }
        catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    
}
private void carga_datos_vinculados(int opcion,String idtienda)
    {
         String texto="select * from x1sieuno_articulo_almacen_movextras_vinculados(2,"+this.jtf_idtienda.getText()+",'"+this.jtf_foliotienda.getText()+"','','') as (iddoc integer,fecha date,hora time,idemp integer,cantidad numeric,costo numeric,precio numeric,obs text,foliomee integer,foliomes integer)";
         System.out.println(texto);
                        try
                            {
                            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                            while (rs.next())
                                {
                                    this.jtf_idfoliovin.setText(rs.getString("iddoc"));

                                    this.jtf_idfolioe.setText(rs.getString("foliomee"));
                                    this.jtf_idfolios.setText(rs.getString("foliomes"));
                                }
                            }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }
    }
private void carga_datos_vinculadosdet(int opcion,String idtienda)
    {
        DecimalFormat miformat = new DecimalFormat("############.####");
        String texto="select * from x1sieuno_articulo_almacen_movextras_vinculados(3,"+this.jtf_idtienda.getText()+",'"+this.jtf_idfoliovin.getText()+"','','') as (idreg integer, iddoc integer,idproo integer,costoo numeric,precioo numeric,idprod integer,costod numeric,preciod numeric,cantidad numeric,obs text,exiso numeric,exisd numeric,codigo text,descrip text,clave text,codigod text,descripd text,claved text,fuco date,fucd date)";
        System.out.println(texto);
        Object[] fnewRow = new Object[14];
        double pz=0,coso=0,cosd=0,preo=0,pred=0;
                        try
                            {
                            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                            while (rs.next())
                                {
                                    fnewRow[0]=rs.getString("clave");
                                    fnewRow[1]=rs.getString("codigo");
                                    fnewRow[2]=rs.getString("descrip");
                                    fnewRow[3]=miformat.format(rs.getDouble("costoo"));
                                    fnewRow[4]=rs.getString("precioo");
                                    fnewRow[5]=rs.getString("exiso");
                                    if(rs.getString ("fuco")!=null)
                                        {
                                            fnewRow[13]="(F.U.Compra="+this.fechaeuropea(rs.getString ("fuco"))+")"+rs.getString("obs");
                                        }
                                     else
                                        {
                                             fnewRow[13]=rs.getString("obs");
                                        }
                                    if(rs.getString("idprod")!=null)
                                        {
                                            fnewRow[6]=rs.getString("claved");
                                            fnewRow[7]=rs.getString("codigod");
                                            fnewRow[8]=rs.getString("descripd");
                                            fnewRow[9]=miformat.format(rs.getDouble("costod"));
                                            fnewRow[10]=rs.getString("preciod");
                                            fnewRow[11]=rs.getString("exisd");
                                            fnewRow[12]=rs.getString("cantidad");
                                        }
                                    else
                                        {
                                            fnewRow[6]="";
                                            fnewRow[7]="";
                                            fnewRow[8]="";
                                            fnewRow[9]="";
                                            fnewRow[10]="";
                                            fnewRow[11]="";
                                            fnewRow[12]="";
                                        }
                                    jtable_modelo_moviextrad.addRow(fnewRow);
                                    pz+=rs.getDouble("costoo");
                                    coso+=rs.getDouble("costoo")*rs.getDouble("cantidad");
                                    cosd+=rs.getDouble("costod")*rs.getDouble("cantidad");
                                    preo+=rs.getDouble("precioo")*rs.getDouble("cantidad");
                                    pred+=rs.getDouble("preciod")*rs.getDouble("cantidad");

                                }
                            }
                            catch(Exception e)
                                {
                                    System.out.println(e.getMessage());
                                }
            this.jtf_piezaenvia1.setText(miformat.format(pz));
            this.jtf_importecosto1.setText(miformat.format(coso));
            this.jtf_importeprecio1.setText(miformat.format(preo));
            this.jtf_importecosto2.setText(miformat.format(cosd));
            this.jtf_importeprecio2.setText(miformat.format(pred));
    }
private void carga_datos_detalle(int opcion,String idtienda,String busca)
 {
      
        DecimalFormat miformat = new DecimalFormat("############.####");
        Object[] fnewRow = new Object[8];
        int fila=0;
       //invoco al metodo que trae el recordset de datos
       String texto="select * from x1sieuno_articulo_almacen_movextras_detalle("+opcion+",'"+busca+"',"+idtienda+") as (idmov integer,cns_det_movext integer,cantidadpro real,idalmacenproducto integer,precio real,idtipven integer,preciocosto numeric,existencia double precision,idproducto integer,cns_det_pro integer,descripcioncorta text,precioactual double precision,prerebajaactual real,clave_producto text);";
       System.out.println(texto);
        try
         {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                 fnewRow[0]=rs.getString ("clave_producto");
                 fnewRow[1]=rs.getString ("idproducto")+":"+rs.getString ("descripcioncorta");
                 fnewRow[2]="PZ";
                 fnewRow[3]=miformat.format(rs.getDouble("cantidadpro"));
                 if(variables_global.getnivelusu()<3)
                    {
                        fnewRow[4]=miformat.format(rs.getDouble("preciocosto"));
                        fnewRow[6]=miformat.format(rs.getDouble("preciocosto")*rs.getDouble("cantidadpro"));
                    }
                 else
                    {
                        fnewRow[4]="0";
                        fnewRow[6]="0";
                    }

                 fnewRow[5]=miformat.format(rs.getDouble("precio"));

                 fnewRow[7]=miformat.format(rs.getDouble("precio")*rs.getDouble("cantidadpro"));
                 jtable_modelo_moviextra.addRow(fnewRow);
                  if (fila<=0)
    					{
            					textohtml+= "<tr>";
        				}
					fila++;
                    textohtml+="<th>"+rs.getString ("clave_producto")+"<br>"+rs.getString ("descripcioncorta") + " $"+rs.getString ("precio")+ "<br>"+"<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+rs.getString ("clave_producto")+".JPG\" width=230 height=190 border=0 alt=\"Foto Articulo\" />"+"</th>";
                    if (fila>=4)
                        {
                            textohtml+= "</tr>";
                            fila=0;
                        }

                }
                
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }

}

    private void carga_datos_fotospaginacion(int pagina)
    {
        textohtml="";
        int nif=0,pag=pagina,nobjetotabla=this.jtable_modelo_moviextra.getRowCount(),nip=0,ni=0,fila=0,artxpag=Integer.valueOf(this.jtf_fotosartxpag1.getText().toString());
        float totalpaginas=this.jtable_modelo_moviextra.getRowCount()/artxpag;

        this.jlbl_paginas2.setText("PAGINAS :"+totalpaginas);
             nif=((pag+1)*artxpag);
             nip=((pag)*artxpag);
                        if (nif < nobjetotabla )
                            {
                                nobjetotabla=nif;
                            }
                    System.out.println("filas x pagina"+artxpag+"tOTAL FILAS:"+this.jtable_modelo_moviextra.getRowCount()+" PAGINA ACTUAL "+pagina+" filainicial "+ nip + " Fila Final"+ nobjetotabla);
                    /*Impresion de los productos*/
                        for(ni=nip;ni<nobjetotabla;ni++)
                        {
                            System.out.println(" fila Actual "+ ni );
                                if (fila<=0)
                                    {
                                    	textohtml+= "<tr>";
                                    }
                                    fila++;
                                    textohtml+="<th>"+jtable_modelo_moviextra.getValueAt(ni, 0).toString()+"<br>"+jtable_modelo_moviextra.getValueAt(ni, 1).toString() + " $"+jtable_modelo_moviextra.getValueAt(ni, 5).toString()+ "<br>"+"<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo_moviextra.getValueAt(ni, 0).toString()+".JPG\" width=230 height=190 border=0 alt=\"Foto Articulo\" />"+"</th>";
                                 if (fila>=4)
                                    {
                                        textohtml+= "</tr>";
                                        fila=0;
                                    }
                        }
         this.jepn_fotos.setText("<html><head></head><body><table>"+textohtml+"</table></body></html>");
         System.out.println(" este es html "+ textohtml );
    }

private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jt_foliosdetalle.getSelectedRow();
         String valor[] = jtable_modelo_moviextra.getValueAt(fila, 1).toString().split(":");

        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        articulos_sie_editar fase=new articulos_sie_editar(valor[0]);
        fase.pack();
        fase.setVisible(true);
        //setVisible(false);
    }

private String  fechaeuropea(String fecha) {

         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;

    }
private String DiaSemana(String fe) {
         String dia = "";
       java.util.Date fecha=null;
         try
            {
             fecha = formateador.parse(fe);

           }
        catch (ParseException e)
            {
            //Error, la cadena de texto no se puede convertir en fecha.
            }
        Calendar cal= Calendar.getInstance();
        cal.setTime(fecha);
        //ojo para establecer o recetear cada parte de la fecha por separado
        //cal.set(Calendar.YEAR, fecha.getYear());
        //cal.set(Calendar.MONTH, fecha.getMonth());
        //cal.set(Calendar.DAY_OF_MONTH, fecha.getDay());
        int diaInt = cal.get(Calendar.DAY_OF_WEEK);
        switch (diaInt) {
            case 1:
                dia = "Domingo";
                break;
            case 2:
                dia = "Lunes";
                break;
            case 3:
                dia = "Martes";
                break;
            case 4:
                dia = "Miercoles";
                break;
            case 5:
                dia = "Jueves";
                break;
            case 6:
                dia = "Viernes";
                break;
            case 7:
                dia = "Sabado";
                break;

        }
        return dia;
    }
private void imprimir(int pag,float ptotal)
    {

     java.util.Date fechahoya=new Date();

     this.objimpresora=new articulos_sie_almacen_movi_imprimir();
    System.out.println("bloque:"+pag+" "+ptotal+" Evaluando impresion");
     this.objimpresora.setOneItem_cadenas_a_imprimir("            Id-Rep:                S.I.:Re-impresion Reclasificacion Articulos");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("Fecha:"+this.+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Tienda:"+this.jtf_idtienda.getText()+"     Descripcion:"+this.jtf_foliotienda1.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Folio:"+ this.jtf_idfoliovin.getText()+"  Fecha Documento:"+this.jtf_fecharecibidotienda.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Observaciones:"+this.jep_observaenvio.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Folio de Movimiento Extra de Entrada:"+this.jtf_idfolioe.getText()+" Folio de Movimiento Extra de Salida:"+this.jtf_idfolios.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("paginas:"+ pag + " de "+ptotal+"");
     System.out.println("bloque:"+pag+" "+ptotal+" Evaluando impresion");
     if((pag+1)>=ptotal)
        {
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Total Piezas : "+this.jtf_piezaenvia1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Costo Salida : "+this.jtf_importecosto1.getText()+"          Costo Entrada : "+this.jtf_importecosto2.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Precio Salida : "+this.jtf_importeprecio1.getText()+"          Precio Entrada : "+this.jtf_importeprecio2.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Solicita                                       Vo.Bo                                        Aplica");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          ___________________              _______________________              ________________________");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Gerente Tienda                             Supervisor                                 Area Sistemas");
        this.objimpresora.setOneItem_cadenas_a_imprimir("..");
        }
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Pagina: "+(pag+1)+" de"+ptotal);
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");

     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jt_foliosdetalle1);
     this.objimpresora.imprimir_all(3,pag);
    }
private void imprimir_defectuoso(int pag,float ptotal)
    {

     java.util.Date fechahoya=new Date();

     this.objimpresora=new articulos_sie_almacen_movi_imprimir();
    System.out.println("bloque:"+pag+" "+ptotal+" Evaluando impresion");
     this.objimpresora.setOneItem_cadenas_a_imprimir("            Id-Rep:                S.I.:Re-Impresio de Baja de Articulos por Defectuoso");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("Fecha:"+this.+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Tienda:"+this.jtf_foliotienda.getText()+"     Descripcion:"+this.tf_tiendaorigen.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Folio:"+ this.jtf_idfoliovin.getText()+"  Fecha Documento:"+this.jtf_fecharecibidotienda.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Observaciones:"+this.jep_observaenvio.getText()+"");
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Folio de Movimiento Extra de Salida:"+this.jtf_idfoliovin.getText());
     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     //this.objimpresora.setOneItem_cadenas_a_imprimir("paginas:"+ pag + " de "+ptotal+"");
     System.out.println("bloque:"+pag+" "+ptotal+" Evaluando impresion");
     if((pag+1)>=ptotal)
        {
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Total Piezas: "+this.jtf_piezaenvia1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Costo Salida: "+this.jtf_importecosto1.getText());
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Precio Salida: "+this.jtf_importeprecio1.getText());

        this.objimpresora.setOneItem_cadenas_a_imprimir("          Solicita                                       Vo.Bo                                        Aplica");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          ___________________                _______________________              ________________________");
        this.objimpresora.setOneItem_cadenas_a_imprimir("          Gerente Tienda                       Supervisor                                 Area Sistemas");
        this.objimpresora.setOneItem_cadenas_a_imprimir("..");
        }
     this.objimpresora.setOneItem_cadenas_a_imprimir("          Pagina: "+(pag+1)+" de"+ptotal);
     this.objimpresora.setOneItem_cadenas_a_imprimir("..");

     this.objimpresora.setOneItem_cadenas_a_imprimir("*");
     this.objimpresora.setObjeto_tabla(jt_foliosdetalle1);
     this.objimpresora.imprimir_all(4,pag);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel3 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        tf_tiendaorigen = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        tf_status = new javax.swing.JTextField();
        jtf_foliotienda = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jtf_fecharecibidotienda = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jtf_elaboro = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        jep_observaenvio = new javax.swing.JEditorPane();
        jLabel14 = new javax.swing.JLabel();
        jtf_movimientos = new javax.swing.JTextField();
        jtf_idfoliovin = new javax.swing.JTextField();
        jtf_idtienda = new javax.swing.JTextField();
        jtf_idfolios = new javax.swing.JTextField();
        jtf_idfolioe = new javax.swing.JTextField();
        jtf_foliotienda1 = new javax.swing.JTextField();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jt_foliosdetalle = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {

                return false;

            }
        }
        ;
        jLabel12 = new javax.swing.JLabel();
        jtf_importecosto = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jtf_importeprecio = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jtf_piezaenvia = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jepn_fotos = new javax.swing.JEditorPane();
        jtf_fotosartxpag1 = new javax.swing.JTextField();
        jlbl_paginas2 = new javax.swing.JLabel();
        jbtn_anterior1 = new javax.swing.JButton();
        jtf_paginaactual1 = new javax.swing.JTextField();
        jbtn_siguiente1 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jt_foliosdetalle1 = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {

                return false;

            }
        }
        ;
        jbtn_imprimir = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jtf_piezaenvia1 = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jtf_importecosto1 = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jtf_importeprecio1 = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        jtf_importecosto2 = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jtf_importeprecio2 = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jmni_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jmni_escape = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(articulos_sie_almacen_movi_extras_detalle.class);
        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        tf_tiendaorigen.setEditable(false);
        tf_tiendaorigen.setFont(resourceMap.getFont("tf_tiendaorigen.font")); // NOI18N
        tf_tiendaorigen.setName("tf_tiendaorigen"); // NOI18N
        tf_tiendaorigen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tf_tiendaorigenActionPerformed(evt);
            }
        });

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        tf_status.setEditable(false);
        tf_status.setFont(resourceMap.getFont("tf_status.font")); // NOI18N
        tf_status.setName("tf_status"); // NOI18N

        jtf_foliotienda.setEditable(false);
        jtf_foliotienda.setFont(resourceMap.getFont("jtf_foliotienda.font")); // NOI18N
        jtf_foliotienda.setName("jtf_foliotienda"); // NOI18N
        jtf_foliotienda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_foliotiendaActionPerformed(evt);
            }
        });

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        jtf_fecharecibidotienda.setEditable(false);
        jtf_fecharecibidotienda.setFont(resourceMap.getFont("jtf_fecharecibidotienda.font")); // NOI18N
        jtf_fecharecibidotienda.setName("jtf_fecharecibidotienda"); // NOI18N

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jtf_elaboro.setEditable(false);
        jtf_elaboro.setFont(resourceMap.getFont("jtf_elaboro.font")); // NOI18N
        jtf_elaboro.setName("jtf_elaboro"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jep_observaenvio.setContentType(resourceMap.getString("jep_observaenvio.contentType")); // NOI18N
        jep_observaenvio.setEditable(false);
        jep_observaenvio.setName("jep_observaenvio"); // NOI18N
        jScrollPane2.setViewportView(jep_observaenvio);

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        jtf_movimientos.setEditable(false);
        jtf_movimientos.setFont(resourceMap.getFont("jtf_movimientos.font")); // NOI18N
        jtf_movimientos.setText(resourceMap.getString("jtf_movimientos.text")); // NOI18N
        jtf_movimientos.setName("jtf_movimientos"); // NOI18N
        jtf_movimientos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_movimientosActionPerformed(evt);
            }
        });

        jtf_idfoliovin.setEditable(false);
        jtf_idfoliovin.setText(resourceMap.getString("jtf_idfoliovin.text")); // NOI18N
        jtf_idfoliovin.setName("jtf_idfoliovin"); // NOI18N

        jtf_idtienda.setEditable(false);
        jtf_idtienda.setText(resourceMap.getString("jtf_idtienda.text")); // NOI18N
        jtf_idtienda.setName("jtf_idtienda"); // NOI18N

        jtf_idfolios.setEditable(false);
        jtf_idfolios.setText(resourceMap.getString("jtf_idfolios.text")); // NOI18N
        jtf_idfolios.setName("jtf_idfolios"); // NOI18N

        jtf_idfolioe.setEditable(false);
        jtf_idfolioe.setText(resourceMap.getString("jtf_idfolioe.text")); // NOI18N
        jtf_idfolioe.setName("jtf_idfolioe"); // NOI18N

        jtf_foliotienda1.setEditable(false);
        jtf_foliotienda1.setFont(resourceMap.getFont("jtf_foliotienda1.font")); // NOI18N
        jtf_foliotienda1.setName("jtf_foliotienda1"); // NOI18N
        jtf_foliotienda1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_foliotienda1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_movimientos, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(tf_tiendaorigen, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_foliotienda, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
                        .addComponent(jtf_foliotienda1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel4))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_fecharecibidotienda, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_elaboro, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tf_status, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jtf_idfoliovin, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_idtienda, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_idfolios, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_idfolioe, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jtf_movimientos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(tf_status, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(tf_tiendaorigen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_foliotienda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_foliotienda1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jtf_idfoliovin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jtf_idtienda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jtf_idfolios, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jtf_idfolioe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(49, 49, 49)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jtf_fecharecibidotienda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(jtf_elaboro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)))
        );

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N
        jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabbedPane1StateChanged(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jPanel1.setName("jPanel1"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jt_foliosdetalle.setModel(this.jtable_modelo_moviextra);
        jt_foliosdetalle.setName("jt_foliosdetalle"); // NOI18N
        jt_foliosdetalle.setRowHeight(22);
        // TODO add your handling code here:
        jt_foliosdetalle.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_foliosdetalleMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    dioclick(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane1.setViewportView(jt_foliosdetalle);

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        jtf_importecosto.setEditable(false);
        jtf_importecosto.setFont(resourceMap.getFont("jtf_importecosto.font")); // NOI18N
        jtf_importecosto.setName("jtf_importecosto"); // NOI18N

        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N

        jtf_importeprecio.setEditable(false);
        jtf_importeprecio.setFont(resourceMap.getFont("jtf_importeprecio.font")); // NOI18N
        jtf_importeprecio.setName("jtf_importeprecio"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jtf_piezaenvia.setEditable(false);
        jtf_piezaenvia.setFont(resourceMap.getFont("jtf_piezaenvia.font")); // NOI18N
        jtf_piezaenvia.setName("jtf_piezaenvia"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(373, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jtf_piezaenvia, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jtf_importecosto, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel13)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtf_importeprecio, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 961, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 442, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jtf_importecosto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13)
                    .addComponent(jtf_importeprecio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_piezaenvia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

        jPanel2.setName("jPanel2"); // NOI18N

        jScrollPane5.setName("jScrollPane5"); // NOI18N

        jepn_fotos.setContentType(resourceMap.getString("jepn_fotos.contentType")); // NOI18N
        jepn_fotos.setName("jepn_fotos"); // NOI18N
        jScrollPane5.setViewportView(jepn_fotos);

        jtf_fotosartxpag1.setText(resourceMap.getString("jtf_fotosartxpag1.text")); // NOI18N
        jtf_fotosartxpag1.setToolTipText(resourceMap.getString("jtf_fotosartxpag1.toolTipText")); // NOI18N
        jtf_fotosartxpag1.setName("jtf_fotosartxpag1"); // NOI18N
        jtf_fotosartxpag1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_fotosartxpag1ActionPerformed(evt);
            }
        });

        jlbl_paginas2.setText(resourceMap.getString("jlbl_paginas2.text")); // NOI18N
        jlbl_paginas2.setName("jlbl_paginas2"); // NOI18N

        jbtn_anterior1.setText(resourceMap.getString("jbtn_anterior1.text")); // NOI18N
        jbtn_anterior1.setName("jbtn_anterior1"); // NOI18N
        jbtn_anterior1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_anterior1ActionPerformed(evt);
            }
        });

        jtf_paginaactual1.setText(resourceMap.getString("jtf_paginaactual1.text")); // NOI18N
        jtf_paginaactual1.setName("jtf_paginaactual1"); // NOI18N
        jtf_paginaactual1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_paginaactual1ActionPerformed(evt);
            }
        });

        jbtn_siguiente1.setText(resourceMap.getString("jbtn_siguiente1.text")); // NOI18N
        jbtn_siguiente1.setName("jbtn_siguiente1"); // NOI18N
        jbtn_siguiente1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_siguiente1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(341, Short.MAX_VALUE)
                .addComponent(jtf_fotosartxpag1, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(50, 50, 50)
                .addComponent(jlbl_paginas2)
                .addGap(27, 27, 27)
                .addComponent(jbtn_anterior1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jtf_paginaactual1, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbtn_siguiente1)
                .addGap(245, 245, 245))
            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 963, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlbl_paginas2)
                    .addComponent(jbtn_anterior1)
                    .addComponent(jbtn_siguiente1)
                    .addComponent(jtf_paginaactual1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_fotosartxpag1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 446, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel2.TabConstraints.tabTitle"), jPanel2); // NOI18N

        jPanel4.setName("jPanel4"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        jt_foliosdetalle1.setModel(this.jtable_modelo_moviextrad);
        jt_foliosdetalle1.setName("jt_foliosdetalle1"); // NOI18N
        jt_foliosdetalle1.setRowHeight(22);
        // TODO add your handling code here:
        jScrollPane3.setViewportView(jt_foliosdetalle1);

        jbtn_imprimir.setIcon(resourceMap.getIcon("jbtn_imprimir.icon")); // NOI18N
        jbtn_imprimir.setText(resourceMap.getString("jbtn_imprimir.text")); // NOI18N
        jbtn_imprimir.setName("jbtn_imprimir"); // NOI18N
        jbtn_imprimir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_imprimirActionPerformed(evt);
            }
        });

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jtf_piezaenvia1.setEditable(false);
        jtf_piezaenvia1.setFont(resourceMap.getFont("jtf_piezaenvia1.font")); // NOI18N
        jtf_piezaenvia1.setName("jtf_piezaenvia1"); // NOI18N

        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N

        jtf_importecosto1.setEditable(false);
        jtf_importecosto1.setFont(resourceMap.getFont("jtf_importecosto1.font")); // NOI18N
        jtf_importecosto1.setName("jtf_importecosto1"); // NOI18N

        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N

        jtf_importeprecio1.setEditable(false);
        jtf_importeprecio1.setFont(resourceMap.getFont("jtf_importeprecio1.font")); // NOI18N
        jtf_importeprecio1.setName("jtf_importeprecio1"); // NOI18N

        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        jtf_importecosto2.setEditable(false);
        jtf_importecosto2.setFont(resourceMap.getFont("jtf_importecosto2.font")); // NOI18N
        jtf_importecosto2.setName("jtf_importecosto2"); // NOI18N

        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        jtf_importeprecio2.setEditable(false);
        jtf_importeprecio2.setFont(resourceMap.getFont("jtf_importeprecio2.font")); // NOI18N
        jtf_importeprecio2.setName("jtf_importeprecio2"); // NOI18N

        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 963, Short.MAX_VALUE)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jtf_piezaenvia1, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel15)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jtf_importecosto1, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel16)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtf_importeprecio1, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel17)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jtf_importecosto2, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel18)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtf_importeprecio2, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jbtn_imprimir)
                .addGap(18, 18, 18)
                .addComponent(jButton1)
                .addContainerGap(11, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 442, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(3, 3, 3)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_piezaenvia1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(jLabel15)
                    .addComponent(jtf_importecosto1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16)
                    .addComponent(jtf_importeprecio1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17)
                    .addComponent(jtf_importecosto2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18)
                    .addComponent(jtf_importeprecio2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtn_imprimir)
                    .addComponent(jButton1))
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
        jmni_salir.setName("jmni_salir"); // NOI18N
        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_salirActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
        jmni_escape.setName("jmni_escape"); // NOI18N
        jmni_escape.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_escapeActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_escape);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 968, Short.MAX_VALUE)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 514, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void tf_tiendaorigenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_tiendaorigenActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_tf_tiendaorigenActionPerformed

    private void jtf_foliotiendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_foliotiendaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_foliotiendaActionPerformed

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
     if(JOptionPane.showConfirmDialog(null, "Desea Salir?")==0) {
             this.dispose();
        }
}//GEN-LAST:event_jmni_salirActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
            int indexactual=this.jTabbedPane1.getSelectedIndex();
            if( tabcontrol==1)
            {
                if(indexactual==1)
                    {
                         this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual1.getText().toString()));
                 
                    }
                if(indexactual==2)
                    {
                        this.carga_datos_vinculados(3, "");
                        this.carga_datos_vinculadosdet(3, this.jtf_idfoliovin.getText());
                    }
            }
    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jtf_fotosartxpag1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fotosartxpag1ActionPerformed
        // TODO add your handling code here:
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual1.getText().toString()));
}//GEN-LAST:event_jtf_fotosartxpag1ActionPerformed

    private void jbtn_anterior1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_anterior1ActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual1.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual1.getText().toString())-1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual1.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual1.getText().toString()));
}//GEN-LAST:event_jbtn_anterior1ActionPerformed

    private void jtf_paginaactual1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_paginaactual1ActionPerformed
        // TODO add your handling code here:
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual1.getText().toString()));
}//GEN-LAST:event_jtf_paginaactual1ActionPerformed

    private void jbtn_siguiente1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_siguiente1ActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual1.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual1.getText().toString())+1));
        System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual1.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual1.getText().toString()));
}//GEN-LAST:event_jbtn_siguiente1ActionPerformed

    private void jtf_movimientosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_movimientosActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtf_movimientosActionPerformed

    private void jtf_foliotienda1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_foliotienda1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtf_foliotienda1ActionPerformed

    private void jbtn_imprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_imprimirActionPerformed
        // TODO add your handling code here:
        float filas=0,paginas=0;
         filas = this.jtable_modelo_moviextrad.getRowCount() ;
                                         paginas = filas /50;
                                         for(int ni=0;ni<paginas;ni++)
                                                {
                                                this.imprimir(ni, paginas);
                                                }
    }//GEN-LAST:event_jbtn_imprimirActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
 float filas=0,paginas=0;
         filas = this.jtable_modelo_moviextrad.getRowCount() ;
                                         paginas = filas /50;
                                         for(int ni=0;ni<paginas;ni++)
                                                {
                                                this.imprimir_defectuoso(ni, paginas);
                                                }

    }//GEN-LAST:event_jButton1ActionPerformed
    private void jt_foliosdetalleMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
            new articulos_sie_almacen_movi_extras_detalle().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_anterior1;
    private javax.swing.JButton jbtn_imprimir;
    private javax.swing.JButton jbtn_siguiente1;
    private javax.swing.JEditorPane jep_observaenvio;
    private javax.swing.JEditorPane jepn_fotos;
    private javax.swing.JLabel jlbl_paginas2;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JTable jt_foliosdetalle;
    private javax.swing.JTable jt_foliosdetalle1;
    private javax.swing.JTextField jtf_elaboro;
    private javax.swing.JTextField jtf_fecharecibidotienda;
    private javax.swing.JTextField jtf_foliotienda;
    private javax.swing.JTextField jtf_foliotienda1;
    private javax.swing.JTextField jtf_fotosartxpag1;
    private javax.swing.JTextField jtf_idfolioe;
    private javax.swing.JTextField jtf_idfolios;
    private javax.swing.JTextField jtf_idfoliovin;
    private javax.swing.JTextField jtf_idtienda;
    private javax.swing.JTextField jtf_importecosto;
    private javax.swing.JTextField jtf_importecosto1;
    private javax.swing.JTextField jtf_importecosto2;
    private javax.swing.JTextField jtf_importeprecio;
    private javax.swing.JTextField jtf_importeprecio1;
    private javax.swing.JTextField jtf_importeprecio2;
    private javax.swing.JTextField jtf_movimientos;
    private javax.swing.JTextField jtf_paginaactual1;
    private javax.swing.JTextField jtf_piezaenvia;
    private javax.swing.JTextField jtf_piezaenvia1;
    private javax.swing.JTextField tf_status;
    private javax.swing.JTextField tf_tiendaorigen;
    // End of variables declaration//GEN-END:variables
private articulos_sie_almacen_movi_imprimir objimpresora;
}
